🧑💻 Какие методы есть у генератора, но нет у итератора?
1️⃣send(value) Позволяет передать значение внутрь генератора. Это значение становится результатом выражения yield в теле генератора.
2️⃣throw(type, value=None, traceback=None) Используется для выбрасывания исключения внутри генератора в точке последнего yield. Позволяет обрабатывать ошибки.
3️⃣close() Завершает выполнение генератора, вызывая исключение GeneratorExit. Обычно используется для освобождения ресурсов.
🧑💻 Какие методы есть у генератора, но нет у итератора?
1️⃣send(value) Позволяет передать значение внутрь генератора. Это значение становится результатом выражения yield в теле генератора.
2️⃣throw(type, value=None, traceback=None) Используется для выбрасывания исключения внутри генератора в точке последнего yield. Позволяет обрабатывать ошибки.
3️⃣close() Завершает выполнение генератора, вызывая исключение GeneratorExit. Обычно используется для освобождения ресурсов.
#вопросы_с_собеседований
BY Python tests
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
Start with a fresh view of investing strategy. The combination of risks and fads this quarter looks to be topping. That means the future is ready to move in.Likely, there will not be a wholesale shift. Company actions will aim to benefit from economic growth, inflationary pressures and a return of market-determined interest rates. In turn, all of that should drive the stock market and investment returns higher.
The S&P 500 slumped 1.8% on Monday and Tuesday, thanks to China Evergrande, the Chinese property company that looks like it is ready to default on its more-than $300 billion in debt. Cries of the next Lehman Brothers—or maybe the next Silverado?—echoed through the canyons of Wall Street as investors prepared for the worst.